package com.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.dao.ReportDao;
import com.entity.UserEntity;
import com.service.ReportService;

/**
 * 描述：
 * @author：<a href="mailto:beier.zheng@yeepay.com">郑贝尔</a>
 * @since：Oct 15, 2012 8:14:03 PM
 * @version:1.0
 */
@Service
public class ReportServiceImpl  implements ReportService{
	@Autowired
	private ReportDao dao;
	
	@Transactional(propagation = Propagation.REQUIRED,rollbackFor=Exception.class)
	public void batchAdd(){
		dao.batchAdd();
	}

	@Override
	public List<UserEntity> queryUsers(UserEntity user) {
		return 	dao.getList("UserEntity.queryUsers",user);
	}
	public List<UserEntity> queryAllUser() {
		return 	dao.getList("UserEntity.queryUsers");
	}

	@Override
	public int saveone(UserEntity user) {
		return dao.save("UserEntity.insert", user);
	}

	
	@Transactional(propagation = Propagation.REQUIRED,rollbackFor=Exception.class)
	public int  deleteTest(UserEntity user){
		return dao.deleteByObject("UserEntity.deleteBy", user);
	}
	
	@Override
	public UserEntity get(String key, UserEntity user) {
		return null;
	}

	
}
